﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Jc.MicroDesigner.Management;

namespace Jc.MicroDesigner.ToolWindows
{
    /// <summary>
    /// Форма редактирования генераторов
    /// </summary>
    public partial class SignalsEditorForm : Form
    {
        void RefreshEditor()
        {
            patternsEditBox.ChangeView(HScroll_Control.Value,VScroll_Control.Value);
        }

        public SignalsEditorForm()
        {
            InitializeComponent();
        }

        public void Show(ObjectManager manager)
        {
            patternsEditBox.Show(manager);
            HScroll_Control.Maximum = ObjectManager.MaxTactCount;
            VScroll_Control.Maximum = manager.Generators.Count;
            ShowDialog();
        }

        private void VScroll_Scroll(object sender, ScrollEventArgs e)
        {
            RefreshEditor();
        }

        private void HScroll_Scroll(object sender, ScrollEventArgs e)
        {
            RefreshEditor();
        }
    }
}